﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RewardGroup : MonoBehaviour {

	[HideInInspector]
	public List<Reward> rewardList;
	[HideInInspector]
	public float width = 0f;
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}

	public float rewardWidth(){
		if (width <= 0f) {
			width = rewardList [0].width;
		}
		return width;
	}

	public float getTotalWidth(){
		if (rewardList.Count < 2) {
			return rewardWidth();
		} else {
			return (rewardList [rewardList.Count - 1].transform.position.x - rewardList [0].transform.position.x + rewardWidth()*2);
		}
	}
}
